<template>
  <view class="about-container">
    <view class="header-section">
      <text class="page-title">关于我们</text>
    </view>
    
    <view class="logo-section">
      <image class="app-logo" src="/static/logo.png" mode="aspectFit"></image>
      <text class="app-name">ShapeUp健身</text>
      <text class="app-version">v1.0.0</text>
    </view>
    
    <view class="info-section">
      <view class="info-item">
        <text class="info-label">应用名称：</text>
        <text class="info-value">ShapeUp健身</text>
      </view>
      
      <view class="info-item">
        <text class="info-label">开发者：</text>
        <text class="info-value">ShapeUp开发团队</text>
      </view>
      
      <view class="info-item">
        <text class="info-label">官方网站：</text>
        <text class="info-value url" @click="openWebsite">www.shapeup.com</text>
      </view>
      
      <view class="info-item">
        <text class="info-label">客服电话：</text>
        <text class="info-value url" @click="callSupport">400-888-8888</text>
      </view>
      
      <view class="info-item">
        <text class="info-label">客服邮箱：</text>
        <text class="info-value url" @click="emailSupport">support@shapeup.com</text>
      </view>
    </view>
    
    <view class="links-section">
      <view class="link-item" @click="userAgreement">
        <text class="link-text">用户协议</text>
        <text class="arrow">›</text>
      </view>
      
      <view class="link-item" @click="privacyPolicy">
        <text class="link-text">隐私政策</text>
        <text class="arrow">›</text>
      </view>
      
      <view class="link-item" @click="rateApp">
        <text class="link-text">给应用评分</text>
        <text class="arrow">›</text>
      </view>
    </view>
    
    <view class="copyright-section">
      <text class="copyright-text">© 2025 ShapeUp健身 版权所有</text>
    </view>
  </view>
</template>

<script setup lang="ts">
import { onMounted } from 'vue'

// 打开官方网站
const openWebsite = () => {
  uni.showToast({
    title: '打开官网功能开发中',
    icon: 'none'
  })
}

// 拨打客服电话
const callSupport = () => {
  uni.makePhoneCall({
    phoneNumber: '400-888-8888'
  })
}

// 发送邮件
const emailSupport = () => {
  uni.showToast({
    title: '发送邮件功能开发中',
    icon: 'none'
  })
}

// 用户协议
const userAgreement = () => {
  uni.showToast({
    title: '用户协议功能开发中',
    icon: 'none'
  })
}

// 隐私政策
const privacyPolicy = () => {
  uni.showToast({
    title: '隐私政策功能开发中',
    icon: 'none'
  })
}

// 给应用评分
const rateApp = () => {
  uni.showToast({
    title: '评分功能开发中',
    icon: 'none'
  })
}

// 页面加载时的初始化操作
onMounted(() => {
  console.log('关于页面已加载')
})
</script>

<style lang="scss" scoped>
.about-container {
  min-height: 100vh;
  background-color: #FFFFFF;
  padding: 20rpx;
}

.header-section {
  background-color: #fff;
  padding: 30rpx;
  margin-bottom: 20rpx;
  border-radius: 10rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  
  .page-title {
    font-size: 36rpx;
    font-weight: bold;
    color: #333;
    text-align: center;
  }
}

.logo-section {
  background-color: #fff;
  border-radius: 10rpx;
  padding: 60rpx 30rpx;
  margin-bottom: 20rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  text-align: center;
}

.app-logo {
  width: 150rpx;
  height: 150rpx;
  margin-bottom: 30rpx;
}

.app-name {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
  display: block;
  margin-bottom: 20rpx;
}

.app-version {
  font-size: 28rpx;
  color: #999;
}

.info-section {
  background-color: #fff;
  border-radius: 10rpx;
  padding: 30rpx;
  margin-bottom: 20rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
}

.info-item {
  display: flex;
  margin-bottom: 20rpx;
  
  &:last-child {
    margin-bottom: 0;
  }
}

.info-label {
  font-size: 28rpx;
  color: #666;
  width: 180rpx;
}

.info-value {
  font-size: 28rpx;
  color: #333;
  flex: 1;
}

.url {
  color: #4B0082;
  
  &:active {
    opacity: 0.8;
  }
}

.links-section {
  background-color: #fff;
  border-radius: 10rpx;
  margin-bottom: 20rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.link-item {
  display: flex;
  align-items: center;
  padding: 30rpx;
  border-bottom: 1rpx solid #eee;
  
  &:last-child {
    border-bottom: none;
  }
  
  &:active {
    background-color: #f5f5f5;
  }
}

.link-text {
  flex: 1;
  font-size: 32rpx;
  color: #333;
}

.arrow {
  font-size: 36rpx;
  color: #ccc;
}

.copyright-section {
  text-align: center;
  padding: 30rpx;
}

.copyright-text {
  font-size: 24rpx;
  color: #999;
}
</style>